package com.example.learn_gl_android.anglib.util

import android.util.JsonReader
import android.util.Log
import com.example.learn_gl_android.anglib.core.gl.ServiceLocator
import java.io.InputStreamReader

class JsonUtil {
    fun toObject(){
        val iStream = ServiceLocator.getService().resources.assets.open("a.json")
        var rd = InputStreamReader(iStream)

        val reader = JsonReader(rd)
        var  name = ""
        reader.beginObject()
        while (reader.hasNext()){
            name = reader.nextName()
            Log.i("GL", name)
            if (name == "a"){
                Log.i("GL", reader.nextString())
            }
        }
        reader.endObject()
        var jsonToken = reader.peek()

    }
}